import Vue from 'vue'
import Router from 'vue-router'
import Home from '../views/Home'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home,
      meta: { title: '  首页  ', isAuthenticated: false }
    },
    {
      path: '/About',
      name: 'About',
      component: resolve => require(['@/views/About'], resolve),
      meta: { title: '关于App', isAuthenticated: false }
    },
    {
      path: '/TopDownload',
      name: 'TopDownload',
      component: resolve => require(['@/views/TopDownload'], resolve),
      meta: { title: '下载排行', isAuthenticated: false }
    },
    {
      path: '/Apps',
      name: 'Apps',
      component: resolve => require(['@/views/Apps'], resolve),
      meta: { title: 'App下载', isAuthenticated: false }
    },
    {
      path: '/Mine',
      name: 'Mine',
      component: resolve => require(['@/views/user/Mine'], resolve),
      meta: { title: '我的', isAuthenticated: true }
    },
    {
      path: '/Login',
      name: 'Login',
      component: resolve => require(['@/views/user/Login'], resolve),
      meta: { title: '请先登录', isAuthenticated: true }
    },
    {
      path: '/404',
      component: resolve => require(['@/views/Page404'], resolve),
      hidden: true,
      meta: { title: '页面不存在', isAuthenticated: false }
    },
    { path: '*', redirect: '/404', hidden: true }
  ]
})
